---
id: 5900f3e01000cf542c50fef3
title: '問題116: 紅色、綠色或藍色瓷磚'
challengeType: 1
forumTopicId: 301742
dashedName: problem-116-red-green-or-blue-tiles
---

# --description--

A row of five black square tiles is to have a number of its tiles replaced with coloured oblong tiles chosen from red (length two), green (length three), or blue (length four).

如果選擇紅色瓷磚，有七種方法可以做到這一點。

<img class="img-responsive center-block" alt="將紅色塊放在長度爲 5 個單元的一行中的可能方法" src="https://cdn.freecodecamp.org/curriculum/project-euler/red-green-or-blue-tiles-1.png" style="background-color: white; padding: 10px;" />

If green tiles are chosen there are three ways.

<img class="img-responsive center-block" alt="將綠色塊放在長度爲 5 個單位的一行中的可能方法" src="https://cdn.freecodecamp.org/curriculum/project-euler/red-green-or-blue-tiles-2.png" style="background-color: white; padding: 10px;" />

And if blue tiles are chosen there are two ways.

<img class="img-responsive center-block" alt="將藍色塊放在長度爲 5 個單位的一行中的可能方法" src="https://cdn.freecodecamp.org/curriculum/project-euler/red-green-or-blue-tiles-3.png" style="background-color: white; padding: 10px;" />

假定顏色不能混合，則有 7 + 3 + 2 = 12 種方法來替換長度爲 5 個單位的黑色瓷磚。 如果顏色不能混合且至少必須使用一個彩色瓷塊，那麼一行長度爲50個單位的黑色瓷塊可以有多少種不同的更換方式？

**注意：** 這與問題 117 有關。

# --hints--

`redGreenBlueOne()` 應該返回 `20492570929`。

```js
assert.strictEqual(redGreenBlueOne(), 20492570929);
```

# --seed--

## --seed-contents--

```js
function redGreenBlueOne() {

  return true;
}

redGreenBlueOne();
```

# --solutions--

```js
// solution required
```
